<script type='text/javascript' language='javascript'>
    var contents = [];
<?php foreach ($this->parameters as $data): ?>
        contents.push({"id":'<?php echo $data['id'] ?>',"name":'<?php echo $data['title'] ?>',"category_id":'<?php echo $data['category_id'] ?>'})
<?php endforeach; ?>
    $().ready(function(){
        $('#category_id').change(function(){
            var html ='';
            var category =$('#category_id option:selected').text();
            alert(category);
            for(var y=0;y<contents.length;y++){
                if(contents[y].category_id == category){
                    html +="<option value='"+contents[y].id+"'>"+contents[y].name+"</option>";
                }
            }
            $('#article').html(html);
            html +='<option value="0">--</option>';
        });
        if($('#category_id').val()) {$('#category_id').trigger('change');}
    });
</script>